﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using TeaLightV5.Foundation.MvvmCross.ViewModels;
using TeaLightV5.Foundation.UX.ViewModels;

namespace Conference.Core.UX.ViewModels
{
    public partial class MainViewModel : EntityViewModel
    {
        private SpeakerListEntityPartModel _speakers;
        private SessionListEntityPartModel _sessions;

        public SpeakerListEntityPartModel Speakers
        {
            get { return _speakers; }
            set { _speakers = value;
            this.RaisePropertyChanged("Speakers");
            }
        }

        public SessionListEntityPartModel Sessions
        {
            get { return _sessions; }
            set
            {
                _sessions = value;
                this.RaisePropertyChanged("Sessions");
            }
        }

        public override void ReloadModel()
        {
            if (Speakers == null)
            {
                Speakers = new SpeakerListEntityPartModel();
            }
            if (Sessions == null)
            {
                Sessions = new SessionListEntityPartModel();
            }
            Speakers.ReloadModel();
            Sessions.ReloadModel();
        }
    }
}
